<?php

class ArticleCategoryViewModel extends ViewModel{
	public $table = 'article';//指定主表表明，不可省略
	public $view = array(
		'article'	=> array('_type'=>'INNER'),
		'category'	=> array('_on'=>'article.cid=category.cid'),

		);

	public function getData(){
		return $this->field('article.*,category.cname')->all();
	}
}

?>